/* 选项卡样式 */
.container{
  max-width: 100% !important; 
}
.tab-content {
  min-height: 500px;
}

.tab-pane {
  display: none;
}

.tab-pane.active,
.tab-pane.show {
  display: block;
}

/* 聊天消息样式 */
#log {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message-container {
  max-width: 70%;
  padding: 8px 12px;
  border-radius: 18px;
  word-wrap: break-word;
}

/* 媒体消息去除内边距 */
.message-container.media {
  padding: 0;
}

/* 用户发送消息 */
.message-container.sent {
  background-color: transparent;
  color: #6C757D;
  margin-left: auto;
  border-bottom-right-radius: 5px;
}

/* 用户接收消息 */
.message-container.received {
  background-color: #FFFFFF;
  color: #333;
  margin-right: auto;
  border: 1px solid #E5E5EA;
  border-bottom-left-radius: 5px;
}

/* 系统状态消息 */
.message-container.system {
  background-color: #F8F9FA;
  color: #6C757D;
  margin-left: auto;
  margin-right: auto;
  max-width: 80%;
  text-align: center;
  font-size: 0.85em;
  font-style: italic;
}

/* 错误消息 */
.message-container.error {
  background-color: #F44336;
  color: white;
  margin-left: auto;
  margin-right: auto;
  max-width: 80%;
  text-align: center;
  font-size: 0.85em;
}

/* 私信消息（接收） */
.message-container.private {
  background-color: #FFC107;
  color: #333;
  margin-right: auto;
  border: 1px solid #FFE082;
}

/* 私信消息（发送） */
.message-container.sent-private {
  background-color: #9C27B0;
  color: white;
  margin-left: auto;
}

/* 时间戳样式 */
.message-time {
  font-size: 0.75em;
  opacity: 0.8;
  margin-top: 2px;
}

.sent .message-time {
  text-align: right;
}

.received .message-time {
  text-align: left;
}

.private .message-time,
.sent-private .message-time {
  text-align: right;
}

/* SQLite 选项卡样式 */
.cursor-pointer {
  cursor: pointer;
}

.hover\:bg-light:hover {
  background-color: #f8f9fa;
}

.table-item.active {
  background-color: #e9ecef;
  font-weight: 500;
}

.db-table {
  width: 100%;
  border-collapse: collapse;
}

.db-table th {
  background-color: #f8f9fa;
  position: sticky;
  top: 0;
  z-index: 10;
}

.db-table th,
.db-table td {
  padding: 8px 12px;
  border: 1px solid #dee2e6;
  text-align: left;
}

.db-table tr:nth-child(even) {
  background-color: #f8f9fa;
}

/* 分页控件样式修复 */
#page-numbers {
  display: flex;
  flex-direction: row;
}

#page-numbers>li {
  margin: 0 2px;
}

/* SSH终端样式 - 针对xterm.js优化 */
#terminal-container {
  height: 500px;
  width: 100%;
  background-color: #000000 !important;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 0;
  margin: 0;
  overflow: hidden;
  position: relative;
}

/* xterm.js 终端样式覆盖 */
#terminal-container .xterm {
  height: 100% !important;
  width: 100% !important;
}

#terminal-container .xterm-viewport {
  background-color: #000000 !important;
  overflow-y: auto;
}

#terminal-container .xterm-screen {
  background-color: #000000 !important;
}

#terminal-container .xterm-helper-textarea {
  position: absolute;
  left: -9999em;
  top: 0;
  width: 0;
  height: 0;
  white-space: nowrap;
  overflow: hidden;
  resize: none;
}

/* 确保终端容器在不同屏幕尺寸下的响应式布局 */
@media (max-width: 768px) {
  #terminal-container {
    height: 400px;
  }
}

@media (max-width: 576px) {
  #terminal-container {
    height: 350px;
  }
}

/* 旧的终端样式保留作为备用 */
.terminal-container-legacy {
  font-size: 14px;
  line-height: 1.4;
  background-color: #1e1e1e !important;
  color: #d4d4d4 !important;
  padding: 15px;
  border-radius: 4px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  outline: none;
  border: 1px solid #333;
  cursor: text;
}

.terminal-container {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
  font-size: 14px;
  line-height: 1.4;
  background-color: #1e1e1e !important;
  color: #d4d4d4 !important;
  padding: 15px;
  border-radius: 4px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  outline: none;
  border: 1px solid #333;
}

.terminal-welcome {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin: 20px;
  padding: 40px 20px;
}

.terminal-welcome i {
  color: #666;
}

.terminal-welcome p {
  color: #888;
  margin-top: 15px;
}

/* 终端光标 */
.terminal-cursor {
  background-color: #d4d4d4;
  color: #1e1e1e;
  animation: blink 1s infinite;
  display: inline-block;
  width: 8px;
  height: 1em;
}

@keyframes blink {

  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0;
  }
}

/* 终端输出样式 */
.terminal-output {
  margin: 0;
  padding: 0;
  white-space: pre-wrap;
}

.terminal-error {
  color: #f44747;
}

.terminal-success {
  color: #4ec9b0;
}

/* 聊天媒体样式 */
.chat-image {
  max-width: 240px;
  max-height: 180px;
  width: auto;
  height: auto;
  border-radius: 6px;
  cursor: pointer;
  display: block;
}

.chat-image:hover {
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}

.image-preview-modal .modal-dialog {
  max-width: 90vw;
}

.image-preview-modal .modal-body {
  text-align: center;
}

.image-preview-modal img {
  max-width: 100%;
  height: auto;
}

/* 聊天视频尺寸限制 */
.chat-video {
  max-width: 240px;
  max-height: 180px;
  width: auto;
  height: auto;
  border-radius: 6px;
  display: block;
}

/* 语音消息气泡（仿 Telegram 简洁风格） */
.audio-bubble {
  display: flex;
  align-items: center;
  gap: 10px;
}

.audio-play {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
}

.message-container.sent .audio-play {
  /* background: rgba(255, 255, 255, 0.25); */
  color: #fff;
}

.message-container.received .audio-play {
  background: #f1f3f5;
  color: #333;
}

.audio-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
}

.audio-time {
  font-size: 0.85em;
  opacity: 0.85;
}

.audio-progress {
  position: relative;
  width: 160px;
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
}

.message-container.sent .audio-progress {
    background: rgb(0 0 0 / 35%);
}

.message-container.received .audio-progress {
  background: #e9ecef;
}

.audio-progress-bar {
  height: 100%;
  width: 0%;
}

.message-container.sent .audio-progress-bar {
  background: #fff;
}

.message-container.received .audio-progress-bar {
  background: #0d6efd;
}

.chat-audio {
  width: 0;
  height: 0;
  opacity: 0;
  position: absolute;
  pointer-events: none;
}
/* 音频消息样式（Telegram风格） */
.audio-bubble { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.audio-play { width: 28px; height: 28px; border-radius: 50%; border: none; background: #0d6efd; color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.message-container.received .audio-play { background: #6c757d; }
.audio-info { display: flex; flex-direction: column; gap: 6px; }
.audio-progress { position: relative; width: 200px; height: 4px; border-radius: 2px; overflow: hidden; }
.message-container.sent .audio-progress { background: rgba(13,110,253,0.2); }
.message-container.received .audio-progress { background: rgba(108,117,125,0.2); }
.audio-progress-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: currentColor; }
.audio-time { font-size: 12px; color: #666; }

/* 麦克风权限提示横幅 */
.permission-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  background: #fff3cd;
  border: 1px solid #ffeeba;
  color: #856404;
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.permission-banner .permission-actions .permission-close {
  background: #ffc107;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  color: #212529;
  cursor: pointer;
}

.audio-progress {
  position: relative;
  width: 200px;
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
}

.terminal-info {
  color: #569cd6;
}

.terminal-prompt {
  color: #4ec9b0;
  font-weight: bold;
}

/* ANSI颜色支持 */
.ansi-black {
  color: #000000;
}

.ansi-red {
  color: #cd3131;
}

.ansi-green {
  color: #0dbc79;
}

.ansi-yellow {
  color: #e5e510;
}

.ansi-blue {
  color: #2472c8;
}

.ansi-magenta {
  color: #bc3fbc;
}

.ansi-cyan {
  color: #11a8cd;
}

.ansi-white {
  color: #e5e5e5;
}

.ansi-bright-black {
  color: #666666;
}

.ansi-bright-red {
  color: #f14c4c;
}

.ansi-bright-green {
  color: #23d18b;
}

.ansi-bright-yellow {
  color: #f5f543;
}

.ansi-bright-blue {
  color: #3b8eea;
}

.ansi-bright-magenta {
  color: #d670d6;
}

.ansi-bright-cyan {
  color: #29b8db;
}

.ansi-bright-white {
  color: #ffffff;
}

/* ANSI背景颜色 */
.ansi-bg-black {
  background-color: #000000;
}

.ansi-bg-red {
  background-color: #cd3131;
}

.ansi-bg-green {
  background-color: #0dbc79;
}

.ansi-bg-yellow {
  background-color: #e5e510;
}

.ansi-bg-blue {
  background-color: #2472c8;
}

.ansi-bg-magenta {
  background-color: #bc3fbc;
}

.ansi-bg-cyan {
  background-color: #11a8cd;
}

.ansi-bg-white {
  background-color: #e5e5e5;
}

/* ANSI文本样式 */
.ansi-bold {
  font-weight: bold;
}

.ansi-dim {
  opacity: 0.5;
}

.ansi-italic {
  font-style: italic;
}

.ansi-underline {
  text-decoration: underline;
}

.ansi-strikethrough {
  text-decoration: line-through;
}

/* 服务器列表操作按钮紧凑样式 */
.server-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.btn-xxs {
  padding: 0.125rem 0.25rem;
  font-size: 0.75rem;
  line-height: 1.2;
}

.list-group-item .btn-xxs {
  white-space: nowrap;
}